Add deprecation guards for deprecated GdkAppLaunchContext API
authorMatthias Clasen <mclasen@redhat.com>
Fri, 24 Dec 2010 22:37:00 +0000 (17:37 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 24 Dec 2010 22:37:00 +0000 (17:37 -0500)
Also adapt the docs to not use deprecated API.

docs/reference/gtk/migrating-2to3.xml
gdk/gdk.c
gdk/gdkapplaunchcontext.c
gdk/gdkapplaunchcontext.h
gdk/gdkdisplay.c
gtk/gtkshow.c

index f10f72e42215094478422481b66702cff5e99c81..a6f3ca8c36f2ada1f3565a41335953a025507ad2 100644 (file)
         GError *error = NULL;
 
         info = g_desktop_app_info_new ("epiphany.desktop");
-        context = gdk_app_launch_context_new ();
+        context = gdk_display_get_app_launch_context (display);
         g_app_info_launch (info, NULL, context, &amp;error);
 
         if (error)
index 79f0b84e9b54da4d7e12765eaebb4d8afdf5ff23..1667226ff5e4294df54a3ed3315e7ad3f9aea5f0 100644 (file)
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -57,7 +57,7 @@
  * Use this macro to guard code that is specific to the X11-backend.
  * Since GDK may be configured with multiple backends, an additional
  * runtime check for the used backend is recommended:
- * </para>
+ *
  * <example>
  * <title>Backend-specific code</title>
  * <programlisting>
index 88d5a538d0eb468b8e7ff45905096b62e5220a21..5f9aa249c53165b27d04cd3de5655f9fdb94cc50 100644 (file)
@@ -41,9 +41,9 @@
  * <programlisting>
  * GdkAppLaunchContext *context;
  *
- * context = gdk_app_launch_context_new (<!-- -->);
+ * context = gdk_display_get_app_launch_context (display);
  *
- * gdk_app_launch_context_set_screen (my_screen);
+ * gdk_app_launch_context_set_screen (screen);
  * gdk_app_launch_context_set_timestamp (event->time);
  *
  * if (!g_app_info_launch_default_for_uri ("http://www.gtk.org", context, &error))
index ad1b1f1760fb5182c5a5b7e93f633cfa4d03d14f..96aeeba967f99ec0970cddd7bc51ebb7e5f6975e 100644 (file)
@@ -40,9 +40,11 @@ G_BEGIN_DECLS
 
 GType                gdk_app_launch_context_get_type      (void);
 
+#ifndef GDK_DISABLE_DEPRECATED
 GdkAppLaunchContext *gdk_app_launch_context_new           (void);
 void                 gdk_app_launch_context_set_display   (GdkAppLaunchContext *context,
                                                            GdkDisplay          *display);
+#endif
 void                 gdk_app_launch_context_set_screen    (GdkAppLaunchContext *context,
                                                            GdkScreen           *screen);
 void                 gdk_app_launch_context_set_desktop   (GdkAppLaunchContext *context,
index 117f906c1ea89ef6790c2371f9ae0fb01af43e03..8941d38a1710df212439b5e7770bba656acb7aed 100644 (file)
@@ -2218,8 +2218,9 @@ gdk_display_real_get_app_launch_context (GdkDisplay *display)
 {
   GdkAppLaunchContext *ctx;
 
-  ctx = gdk_app_launch_context_new ();
-  gdk_app_launch_context_set_display (ctx, display);
+  ctx = g_object_new (GDK_TYPE_APP_LAUNCH_CONTEXT,
+                      "display", display,
+                      NULL);
 
   return ctx;
 }
index e4e5d50d4eef2b8fc0ba03e9ec392fb8f56a0410..551f393b4ebc2845be68f38ed2eb89d73e10207e 100644 (file)
@@ -63,7 +63,7 @@ gtk_show_uri (GdkScreen    *screen,
 
   g_return_val_if_fail (uri != NULL, FALSE);
 
-  context = gdk_app_launch_context_new ();
+  context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
   gdk_app_launch_context_set_screen (context, screen);
   gdk_app_launch_context_set_timestamp (context, timestamp);